#ifndef LOGIC_ADD_H
#define LOGIC_ADD_H

#include <iostream>
#include <string>
#include <vector>
#include <sstream>

#include "LogicBase.h"

#include <boost\date_time.hpp>

using namespace std;
using namespace boost::posix_time;
using namespace boost::gregorian;

class LogicAdd : public LogicBase {
private:
	enum ErrorAdd {
		NO_ERROR,
		ERROR_DATE_PAST,
		ERROR_START_END
	};

public:
	static LogicAdd& getInstance();

	Display addFloatingTask(string taskName);
	Display addDeadlineTask(string taskName, ptime endTime);
	Display addTimedTask(string taskName, ptime startTime, ptime endTime);

private:
	Task _task;

	static const string ADD_SUCCESS_MESSAGE;
	static const string ADD_DEADLINE_BY_CONNECTOR;
	static const string ADD_TIMED_FROM_CONNECTOR;
	static const string ADD_TIMED_TO_CONNECTOR;

	static const string ADD_ERROR_MESSAGE;
	static const string ADD_EXIST_ERROR_MESSAGE;
	static const string ADD_ERROR_CLASH_MESSAGE;
	static const string ADD_DATE_PAST_ERROR_MESSAGE;
	static const string ADD_DATE_START_END_ERROR_MESSAGE;

	ErrorAdd isDateCorrectFormat(ptime startTime, ptime endTime);

	bool isDateClash(ptime startTime, ptime endTime);

	LogicAdd();
	static LogicAdd* _logicAdd;
};
#endif